<?php

$my = new conn();
$my->dbconnect();
$conexion = $my->conexion;
	class conn{
		var $server='localhost';
		var $user='root';
		var $dbase='ecommerce';
		var $pass='';
		var $conexion;
		function conn(){
		}
		function dbconnect(){
		
			if (!($conn=@mysql_connect($this->server,$this->user,$this->pass) )){
				die('<div class="alert" align="center">Error problemas de conexion</div>');
				exit;
			}
		
			if(!(@mysql_selectdb($this->dbase))){
				die('<div class="alert" align="center">Error en la seleccion de la base de datos</div>');
				exit;
			}
		
			$this->conexion=$conn;
			return true;
		}
	}
?>